import React,{lazy} from 'react'
import {Navigate} from 'react-router-dom'
const Home=lazy(()=>import('../pages/home'))
const List=lazy(()=>import('../pages/list'))
const Car=lazy(()=>import('../pages/car'))
const User=lazy(()=>import('../pages/user'))
const Layout=lazy(()=>import('../pages/layout'))
const Login=lazy(()=>import('../pages/login'))
const Text=lazy(()=>import('../pages/text'))
export const routeElement=[{
    path:'/',
    element:<Navigate to="/home"></Navigate>
},{
    path:'/home',
    element:<Home></Home>
},{
    path:'/list',
    element:<List></List>
},{
    path:'/car',
    element:<Car></Car>
},{
    path:'/user',
    element:<User></User>
},]
export default [{
    path:'/',
    element:<Layout></Layout>,
    children:routeElement
},{
    path:'/text:id',
    element:<Text></Text>
},{
    path:'/login',
    element:<Login></Login>
}]